//
//  HJDetailController.swift
//  zhangmiSinweibo
//
//  Created by zhangmi on 16/5/21.
//  Copyright © 2016年 Paramount Pictures. All rights reserved.
//

import UIKit

class HJDetailController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
        
        self.title = "\(navigationController?.childViewControllers.count ?? 0)"
        
        //设置背景颜色
        view.backgroundColor = UIColor.whiteColor()
        
        //返回按钮的手势消失
        //解决办法, 在导航视图控制器重新设置边缘返回手势的代理
        
//        let back = UIBarButtonItem(imageName: "navigationbar_back_withtext", title: "返回", target: self, action: #selector(HJDetailController.back))
//        //设置自定义返回按钮
//        self.navigationItem.leftBarButtonItem = back
        
        //进入多级页面
        navigationItem.rightBarButtonItem = UIBarButtonItem(title: "Next", style: .Plain, target: self, action:  #selector(next))
        
    }
    
    @objc private func next() {
        let next = HJDetailController()
        navigationController?.pushViewController(next, animated: true)
    }
    
    
    
//    @objc private func back() {
//        navigationController?.popViewControllerAnimated(true)
//    }

    

    

}
